shared ptrの例文
- Programmers can use this in conjunction with weak pointers ( via [ [ Shared ptr | ] ] ) to break cyclic dependencies.
- Objects that are dynamically allocated but not intended to be shared can have their lifetime automatically managed using a [ [ Shared ptr | ] ].
- However, by the same token, C + + provides native ways for users to opt-into such functionality : C + + 11 provides reference counted smart pointers, via the [ [ Shared ptr | ] ] class, enabling automatic shared memory-management of dynamically allocated objects.